package validation;

import java.util.ArrayList;
import java.util.List;

import auth.service.User;
import entites.UniteEnseignement;

import net.sf.oval.ConstraintViolation;
import net.sf.oval.Validator;

public class Validate implements Ivalidate {

	

	
	public List<String> validate(Object validatedObject) {
		List<String> l= new ArrayList<String>();

		Validator validator = new Validator();

		
		List<ConstraintViolation> violations = validator.validate( validatedObject);
		
		for (ConstraintViolation error : violations) {
			error.getErrorCode();
			l.add(error.getErrorCode());
			}
		return l;
	}

	public boolean isValide(User user, UniteEnseignement ue) {
		
		return false;
	}

}
